﻿
$(document).ready(function () {
    $('a[rel=shareit]').click(function () {
        var sel = this.name;
        var height = $(this).height();
        var top = $(this).offset().top;
        var left = $(this).offset().left + ($(this).width() / 2) - ($('#shareit-box').width() / 2);
        $('div #shareit-box').css({ 'top': top, 'left': left });
        $('div #shareit-box').filter(function (index) {
            return index == sel-1;
            }).show();
        });

    $('a[class=close]').click(function () {
        $('div #shareit-box').hide();
    });
});